<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>易买网 - 首页</title>
<link type="text/css" rel="stylesheet" href="css/style1.css" />
<script type="text/javascript" src="scripts/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function validate(){
	if(confrim("提交表单?")){
		return true;
	}else{
		return false;
	}
}
 /* $(document).ready(function(){
	$('#submit').click(function(){
		var userName=$('#userName').val();
		var passWord=$('#passWord').val();
			$.post("/easyBuy170601/LogSerlvet",{userName:userName,passWord:passWord},
				function(data){
			if(data=="true"){
				alert("用户名和密码错误");
				return false;
			}else{
				return true;
			}
		},"text")
		
	})		
}) */
 

var code="";//在全局定义验证码
function createCode(){
	code="";
	var codeLength=6;//验证码长度
	var checkCode=document.getElementById("checkCode");
	checkCode.value="";
	var selectChar=new Array(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z');
    for(var i=0;i<codeLength;i++){
    	var charIndex=Math.floor(Math.random()*32);
    	code +=selectChar[charIndex];
    }
    if(code.length!=codeLength){
    	createCode();
    }
    document.getElementById("checkCode").innerHTML=code;
}
function validate(){
	var inputCode=document.getElementById("checkNum").value.toUpperCase();
	if(inputCode.length<=0){
		alert("请输入验证码");
		return false;
	}else if(inputCode!=code){
		alert("验证码输入错误");
		createCode();
		return false;
	}else{
		return true;
	} 
}




</script>
</head>
<body >
<div id="header" class="wrap">
	<div id="logo"><img src="images/logo.gif" /></div>
	<div class="help"><a href="shopping.html" class="shopping">购物车X件</a><a href="login.html">登录</a><a href="register.html">注册</a><a href="guestbook.html">留言</a><a href="manage/index.html">后台管理</a></div>
	<div class="navbar">
		<ul class="clearfix">
			<li class="current"><a href="#">首页</a></li>
			<li><a href="#">图书</a></li>
			<li><a href="#">百货</a></li>
			<li><a href="#">品牌</a></li>
			<li><a href="#">促销</a></li>
		</ul>
	</div>
</div>
<div id="childNav">
	<div class="wrap">
		<ul class="clearfix">
			<li class="first"><a href="#">音乐</a></li>
			<li><a href="#">影视</a></li>
			<li><a href="#">少儿</a></li>
			<li><a href="#">动漫</a></li>
			<li><a href="#">小说</a></li>
			<li><a href="#">外语</a></li>
			<li><a href="#">数码相机</a></li>
			<li><a href="#">笔记本</a></li>
			<li><a href="#">羽绒服</a></li>
			<li><a href="#">秋冬靴</a></li>
			<li><a href="#">运动鞋</a></li>
			<li><a href="#">美容护肤</a></li>
			<li><a href="#">家纺用品</a></li>
			<li><a href="#">婴幼奶粉</a></li>
			<li><a href="#">饰品</a></li>
			<li class="last"><a href="#">Investor Relations</a></li>
		</ul>
	</div>
</div>
<div id="register" class="wrap">
	<div class="shadow">
		<em class="corner lb"></em>
		<em class="corner rt"></em>
		<div class="box">
			<h1>欢迎回到易买网</h1>
			<form id="loginForm" method="post" action="LogSerlvet" >
				<table>
					<tr>
						<td class="field">用户名：</td>
						<td>
                            <input class="text" type="text" id="userName" name="userName" />
							<span id="luserId"></span>
						</td>
					</tr>
					<tr>
						<td class="field">登录密码：</td>
						<td>
                            <input class="text" type="password" id="passWord" name="passWord" />
							<span id="lpassword"></span>
						</td>
					</tr>
					<tr>
					<td class="field">验证码：</td>
						<td>
                            <a id="checkCode" onclick="createCode()" name="checkCode"></a><span onclick="createCode()">点击验证码</span><br/>
	                        <input type="text" name="code" id="checkNum" name="checkNum"><div class="mess"></div>
							<span></span> 
						</td>
					</tr>
					<tr>
						<td></td>
						<td><label class="ui-green"><input type="submit" name="submit" value="立即登录" id="submit" onclick="return validate()" /></label></td>
					</tr>
					
				</table>
			</form>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2010云和学院 All Rights Reserved. 京ICP证1000001号</div>
</body>
</html>